<template>
  <div class="pageSide">
      <div class="pageMenu">
          <router-link class="item" to="/safety">
            <img src="./../images/nav-information.png">
            {{lang.basic_essentialInformation}}
          </router-link>
          <router-link class="item" to="/safety/strategy/">
            <img src="./../images/nav-tactics.png">
            {{lang.basic_safeStrategy}}
          </router-link>
          <router-link class="item" to="/safety/log/">
            <img src="./../images/nav-log.png">
            {{lang.basic_securityLog}}
          </router-link>

          <router-link class="item" to="/api">
            <img src="./../images/nav-api.png">
            {{lang['api My API']}}
          </router-link>
          
          <a class="item" :href="inviteConfig.Url2" v-if="inviteConfig.Status===2">
            <img src="./../images/Invitation.png">
            {{inviteConfig.Name}}
          </a>
          <!-- current -->
      </div>
  </div>
</template>
<script>
export default {
  props: {
    lang: {} // 弹窗控制
  },
  data () {
    return {
      inviteConfig: {}      // 邀请链入口所有信息
    }
  },
  computed: {

  },
  methods: {
    // 邀请返佣入口是否显示、文字、跳转路径由后端控制
    invite () {
      this.$host3.post('IDCMInvite/GetInviteEnterData', {
        type: 1,
        host: window.location.hostname  // 廖路要求（前端不建议这么处理，后端完全可以通过header来获取请求来源，没必要加个域名来源）
      }).then((res) => {
        this.inviteConfig = res.data || {}
      })
    }
  },
  mounted () {
    this.invite()
  }
}
</script>

